<!--  -->
<template>
  <div class="height100">
    <div @click="changeValue">2222</div>
        <ts-date
              v-model="dateNow"
              type="range"
              width="100%"
            ></ts-date>
    <!-- <ts-checkbox
      v-model="borderChoose"
      title="显示边框"
      :data="borderOption"
      width="100%"
      @change="refresh($event, 'borderChoose')"
    ></ts-checkbox> -->
    {{frequency}}
    <ts-checkbox v-model="frequency" title-width="60" :data="frequencySource" title="统计频次"></ts-checkbox>
    <!-- <ts-screen-date
      @refreshData="refreshDataTimer"
      :isNeedDate="false"
      timerWidth="100%"
      :timerName="5000"
    ></ts-screen-date>-->
    <ts-button @click="submit">提交</ts-button>
    <ts-form :data="formData" ref="xForm" :rules="rules" @submit="saveTarget">
      <div slot="formCon">
        <ts-form-item field="definition">
          {{formData.definition}}
          <!-- <vxe-textarea v-model="formData.definition" placeholder="默认尺寸"></vxe-textarea> -->
          <ts-textarea
            v-model="formData.definition"
            title-width="60"
            title="指标定义"
            placeholder="请输入指标定义"
            :emphasize="true"
          ></ts-textarea>
        </ts-form-item>
        <ts-row type="flex">
          <ts-col :flex="1">
            <ts-form-item field="targetVersion5555" style="flex:1;" title="$$$">
              <ts-input
                title-width="60"
                v-model="formData.targetVersion5555"
                title="指标版本"
                placeholder="系统自动生成"
                name="targetVersion"
              ></ts-input>
            </ts-form-item>
          </ts-col>
          <ts-col :flex="1">
            <ts-form-item field="targetVersion" style="flex:1;">
              <ts-input
                title-width="60"
                v-model="formData.targetVersion11"
                title="指标版本"
                placeholder="系统自动生成"
                name="targetVersion"
                disabled
              ></ts-input>
            </ts-form-item>
          </ts-col>
        </ts-row>
        <div style="display:flex;">
          <ts-form-item field="code22" style="flex:1;">
            <ts-input
              title-width="60"
              v-model="formData.code22"
              title="指标编码"
              placeholder="请输入指标编码"
              name="code"
              :emphasize="true"
            ></ts-input>
          </ts-form-item>
          <ts-form-item field="targetVersion33" style="flex:1;">
            <ts-input
              title-width="60"
              v-model="formData.targetVersion33"
              title="指标版本"
              placeholder="系统自动生成"
              name="targetVersion"
              disabled
            ></ts-input>
          </ts-form-item>
          <ts-form-item>
            <ts-textarea
              title="请求地址"
              v-model="formData.reqUrl"
              height="100px"
            >
              <div slot="after">
                <ts-button
                  style="margin-left:5px"
                >ddd</ts-button>
              </div>
            </ts-textarea>
          </ts-form-item>
          <!-- <ts-input
              type="password"
              v-model="formData.repwd"
              title="重复密码"
              :emphasize="true"
              placeholder
              name="repwd"
            >
              <span class="font12">
                注：
                <span style="color:red;">密码不能以空格开始和结尾</span>
                <br />
                <span style="text-indent:2.2em;display:inline-block;color:red;">密码不能小于六位</span>
              </span>
          </ts-input>-->
        </div>
        <!-- <ts-form-item field="name">
          <ts-switch
            title="计算指标"
            v-model="formData.calculateFlag444"
            title-width="60"
            on-label="是"
            off-label="否"
            on-value="01"
            off-value="02"
            :emphasize="true"
          ></ts-switch>
        </ts-form-item>-->

        <!-- <ts-form-item field="filter">
          <ts-switch
            off-value="02"
            on-value="01"
            name="status"
            off-label="否"
            on-label="是"
            title="是否关联其他指标"
            v-model="formData.filter55"
          />
        </ts-form-item>-->
        <div class="none">
          <ts-button type="submit" status="primary" ref="configSubmit" class="mrgl5">提交</ts-button>
        </div>
      </div>
    </ts-form>
  </div>
</template>

<script>
export default {
  data() {
    return {
      dateNow:'',
      formData: {},
      rules: {
        code22: [{ required: true, message: '请输入指标编码' }],
        targetVersion33: [{ required: true, message: '请输入xxx' }],
        targetVersion5555: [
          { required: true, message: '请输入targetVersion5555' }
        ]
      },
      borderChoose: [
        // {name:'name1',value:1},
        { name: 'name2', value: 2 },
        { name: 'name3', value: 3 },
        { name: 'name4', value: 4 }
      ],
      borderOption: [
        { name: 'name1', value: 1, text: '上边框' },
        { name: 'name2', value: 2, text: '下边框' },
        { name: 'name3', value: 3, text: '左边框' },
        { name: 'name4', value: 4, text: '右边框' }
      ],
      frequency: 'DAY,MONTH,QUARTER',
      frequencySource: [
        { value: 'DAY', text: '日' },
        { value: 'MONTH', text: '月' },
        { value: 'QUARTER', text: '季' },
        { value: 'YEAR', text: '年' },
        { value: 'SAME', text: '同比' },
        { value: 'CHAIN', text: '环比' }
      ]
    }
  },

  components: {},

  computed: {},

  watch: {},

  mounted() {},

  created() {},

  methods: {
    changeValue(){
      this.frequency=''
    },
    refresh(val) {},
    refreshDataTimer() {
      console.log('刷新')
    },
    submit() {
      this.$utils.msg(this, '操作成功', 'success')
      this.$refs.xForm.submit()
    },
    saveTarget() {
      
    }
  }
}
</script>
<style lang='scss' scoped>
</style>